{% extends 'fruitShop/base_goods.html' %}

{% block body_content_inner %}
{% load static %}
	<div class="navbar_con">
		<div class="navbar clearfix">
			<div class="subnav_con fl">
				<h1>全部商品分类</h1>
				<span></span>
				<ul class="subnav">
                    {% for cate in categories %}
					<li><a href="{% url 'fruitShop:list' cate.id 1 1 %}" class="{{ cate.className }}">{{ cate.title }}</a></li>
                    {% endfor %}
				</ul>
			</div>
			<ul class="navlist fl">
				<li><a href="">首页</a></li>
				<li class="interval">|</li>
				<li><a href="">手机生鲜</a></li>
				<li class="interval">|</li>
				<li><a href="">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="breadcrumb">
		<a href="/">全部分类</a>
		<span>></span>
		<a href="{% url 'fruitShop:list' newGoods.0.category.id 1 1 %}">{{ newGoods.0.category.title }}</a>
	</div>

	<div class="main_wrap clearfix">
		<div class="l_wrap fl clearfix">
			<div class="new_goods">
				<h3>新品推荐</h3>
				<ul>
                    {% for new in newGoods %}
					<li>
						<a href="{% url 'fruitShop:detail' new.id %}"><img src="{% static 'fruitShop/upload_images/' %}{{ new.picture }}"></a>
						<h4><a href="#">{{ new.name }}</a></h4>
						<div class="prize">￥{{ new.price }}</div>
					</li>
                    {% endfor %}
				</ul>
			</div>
		</div>

		<div class="r_wrap fr clearfix">
			<div class="sort_bar">
				<a href="{% url 'fruitShop:list' c_id 1 1 %}"
                   {% if sort == '1' %}
                        class="active"
                   {% endif %}
                >默认</a>
				<a href="{% url 'fruitShop:list' c_id 1 2 %}" {% if sort == '2' %}
                        class="active"
                   {% endif %}>价格</a>
				<a href="{% url 'fruitShop:list' c_id 1 3 %}" {% if sort == '3' %}
                        class="active"
                   {% endif %}>人气</a>
			</div>

			<ul class="goods_type_list clearfix">
                {% for good in page %}
				<li>
					<a href="{% url 'fruitShop:detail' good.id %}"><img src="{% static 'fruitShop/upload_images/' %}{{ good.picture }}"></a>
					<h4><a href="detail.html">{{ good.name }}</a></h4>
					<div class="operate">
						<span class="prize">￥{{ good.price }}</span>
						<span class="unit">{{ good.price }}/{{ good.unit }}</span>
						<a href="javascript:;" onclick="addCart({{ good.id }})" class="add_goods" title="加入购物车"></a>
					</div>
				</li>
                {% endfor %}
			</ul>

			<div class="pagenation">
                {% if page.has_previous %}
				<a href="{% url 'fruitShop:list' c_id page.previous_page_number sort %}"><上一页</a>
                {% endif %}

                {% for p_index in page.paginator.page_range %}
                    {% if p_index == page.number %}
                        <a href="javascript:;" class="active">{{ p_index }}</a>
                    {% else %}
                        <a href="{% url 'fruitShop:list' c_id p_index sort %}">{{ p_index }}</a>
                    {% endif %}
                {% endfor %}

                {% if page.has_next %}
                    <a href="{% url 'fruitShop:list' c_id page.next_page_number sort %}">下一页></a>
                {% endif %}
			</div>
		</div>
	</div>

{% endblock %}
{% block js %}

{% endblock %}